package com.ds.infrastructure.hyperspace.console.model.request.monitor;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.time.DateUtils;

import java.util.Date;

/**
 * @author: yaozhendong
 * @create: 2019-11-04 14:04
 **/
@Data
@NoArgsConstructor
public class GetMetricsForm {
    private Long stageId;
    private String serviceName;
    @ApiModelProperty(example = "2019-11-26 14:56:00")
    private Date endTime = new Date();
    @JsonIgnore
    @ApiModelProperty(example = "2019-11-26 14:40:00")
    private Date beginTime;

    public Date getBeginTime() {
        return DateUtils.addMinutes(endTime, -16);
    }
}
